(DEFUN c:repltxtnos ()  
  (setq text_nos_ss (ssget))
  (IF text_nos_ss
    (PROGN
      (SETQ old_repl_attreq (GETVAR "attreq"))
      (SETQ old_repl_attdia (GETVAR "attdia"))
      (SETQ old_repl_osmode (GETVAR "OSMODE"))
      (SETQ old_repl_clayer (GETVAR "CLAYER"))
      (SETVAR "ATTREQ" 1)
      (SETVAR "ATTDIA" 0)
      (SETVAR "OSMODE" 0)
      (IF dimscl NIL (LOAD "dimscl" "\nFile DIMSCL.LSP not loaded! "))
      (dimscl)
      (SETQ ss_cnt 0)
      (WHILE (< ss_cnt (SSLENGTH text_nos_ss))
        (setq ename (SSNAME text_nos_ss ss_cnt))
        (SETQ this_text_ent (ENTGET ename))
        (IF (EQ (CDR (ASSOC 0 this_text_ent)) "TEXT")
          (PROGN
            (IF (AND (/= (CDR (ASSOC 8 this_text_ent)) (GETVAR "CLAYER"))(NOT (WCMATCH (CDR (ASSOC 8 this_text_ent)) "*|*")))
              (COMMAND ".LAYER" "M" (CDR (ASSOC 8 this_text_ent)) "")
            )
            (SETQ this_text_str (CDR (ASSOC 1 this_text_ent)))
            (SETQ this_text_ins (CDR (ASSOC 10 this_text_ent)))
            (SETQ this_text_ang (CDR (ASSOC 50 this_text_ent)))
            (COMMAND ".insert" "ITEM_NO" this_text_ins dimsc (* 180.0 (/ this_text_ang PI)) this_text_str "")
          )
        )
        (ENTDEL ename)
        (SETQ ss_cnt (1+ ss_cnt))
      )
      (SETVAR "ATTREQ" old_repl_attreq)
      (SETVAR "ATTDIA" old_repl_attdia)
      (SETVAR "OSMODE" old_repl_osmode)
      (SETVAR "CLAYER" old_repl_clayer)
    )
  )
  (PRINC)
)